package com.chenyaowei.marketing.service.impl;

import com.chenyaowei.marketing.domain.CywCouponSpuCategoryRelation;
import com.chenyaowei.marketing.mapper.CywCouponSpuCategoryRelationMapper;
import com.chenyaowei.marketing.service.ICywCouponSpuCategoryRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 优惠券分类关联Service业务层处理
 * 
 * @author 陈耀威
 * @date 2023-11-28
 */
@Service
public class CywCouponSpuCategoryRelationServiceImpl implements ICywCouponSpuCategoryRelationService 
{
    @Autowired
    private CywCouponSpuCategoryRelationMapper cywCouponSpuCategoryRelationMapper;

    /**
     * 查询优惠券分类关联
     * 
     * @param id 优惠券分类关联主键
     * @return 优惠券分类关联
     */
    @Override
    public CywCouponSpuCategoryRelation selectCywCouponSpuCategoryRelationById(Long id)
    {
        return cywCouponSpuCategoryRelationMapper.selectCywCouponSpuCategoryRelationById(id);
    }

    /**
     * 查询优惠券分类关联列表
     * 
     * @param cywCouponSpuCategoryRelation 优惠券分类关联
     * @return 优惠券分类关联
     */
    @Override
    public List<CywCouponSpuCategoryRelation> selectCywCouponSpuCategoryRelationList(CywCouponSpuCategoryRelation cywCouponSpuCategoryRelation)
    {
        return cywCouponSpuCategoryRelationMapper.selectCywCouponSpuCategoryRelationList(cywCouponSpuCategoryRelation);
    }

    /**
     * 新增优惠券分类关联
     * 
     * @param cywCouponSpuCategoryRelation 优惠券分类关联
     * @return 结果
     */
    @Override
    public int insertCywCouponSpuCategoryRelation(CywCouponSpuCategoryRelation cywCouponSpuCategoryRelation)
    {
        return cywCouponSpuCategoryRelationMapper.insertCywCouponSpuCategoryRelation(cywCouponSpuCategoryRelation);
    }

    /**
     * 修改优惠券分类关联
     * 
     * @param cywCouponSpuCategoryRelation 优惠券分类关联
     * @return 结果
     */
    @Override
    public int updateCywCouponSpuCategoryRelation(CywCouponSpuCategoryRelation cywCouponSpuCategoryRelation)
    {
        return cywCouponSpuCategoryRelationMapper.updateCywCouponSpuCategoryRelation(cywCouponSpuCategoryRelation);
    }

    /**
     * 批量删除优惠券分类关联
     * 
     * @param ids 需要删除的优惠券分类关联主键
     * @return 结果
     */
    @Override
    public int deleteCywCouponSpuCategoryRelationByIds(Long[] ids)
    {
        return cywCouponSpuCategoryRelationMapper.deleteCywCouponSpuCategoryRelationByIds(ids);
    }

    /**
     * 删除优惠券分类关联信息
     * 
     * @param id 优惠券分类关联主键
     * @return 结果
     */
    @Override
    public int deleteCywCouponSpuCategoryRelationById(Long id)
    {
        return cywCouponSpuCategoryRelationMapper.deleteCywCouponSpuCategoryRelationById(id);
    }

    @Override
    public List<CywCouponSpuCategoryRelation> selectListByCouponIds(List<Long> couponIds) {
        return cywCouponSpuCategoryRelationMapper.selectListByCouponIds(couponIds);
    }

    @Override
    public List<CywCouponSpuCategoryRelation> selectListByCouponId(Long couponId) {
        return cywCouponSpuCategoryRelationMapper.selectListByCouponId(couponId);
    }
}
